Skip to content

Charts, maps, media and export (#66, Part 8) - #76

Merged
n4ff4h merged 13 commits into
devfrom
fix/66-part8-media-export
Nov 18, 2026
Merged

n4ff4h merged 13 commits into
devfrom
fix/66-part8-media-export

Conversation

@n4ff4h

@n4ff4h n4ff4h commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes Part 8 of #66 (charts, maps, media and export). One commit per item, each with a test that failed first, a changeset, and docs updates where behaviour or API changed.

Item Change
8.1 Excel date/datetime cells are written as the local wall-clock time (moved into UTC, which is how write-excel-file serialises), so they match CSV and PDF. Reproduced with TZ=Indian/Maldives.
8.2 toDate rejects NaN, Infinity and out-of-range timestamps; such cells are empty. PDF no longer throws a RangeError, CSV no longer writes NaN-NaN-NaN.
8.3 TimeSeriesChart interval now buckets rows: each row goes to the start of its hour/day/week/month, rows in one step are added up (new aggregate="mean" averages them), weeks count from the first date so off-grid rows are kept, and a range of more than 10,000 steps keeps all rows (without gap rows) instead of cutting off the newest. normalizeTimeSeries takes aggregate as a 4th argument.
8.4 MediaPlayer keys the <video>/<audio> element by its source list, so a new src loads.
8.5 SignaturePad: penColor now defaults to #000 and is the ink both on screen and in the export; in dark mode the canvas is shown with dark:invert dark:hue-rotate-180, and the border/background moved to the wrapper so they aren't inverted. A saved defaultValue image is redrawn after a resize (strokes on top).
8.6 cropImage fills JPEG output white before drawing, so transparent areas aren't black. AvatarUpload names the file after the output type (me.png with cropOptions={{ type: "image/png" }}).
8.7 (first 3 bullets) QrCode: with no background of its own (tone="transparent"), a light foreground is saved as #000000 on white. The SVG download fetches the logo and embeds it as a data URL, and leaves it out when it can't be fetched. A failed download shows "Could not download the QR code" as an alert (new file.qrDownloadFailed, en + dv).
8.8 QrCodeScanner continuous: a code that stays in view is reported once and counts again after a second out of view. If the detector fails to load, the new decoder-error status keeps the Start button so the user can retry (new input.scanDecoderError, en + dv).
8.9 (first 3 bullets) Google Draw merges the terra-draw snapshot with the current value, so a shape with too few points to draw (being typed in) survives map edits. LiveMap: when a marker changes in markers (position, heading or updatedAt) or leaves it, its earlier streamed update is dropped, and subscribe(push, remove) gets a remove(id) callback. Geocoding uses the MapProvider region (added to the map context).
8.10 (MapChart half) MapChart stores the selected region's id and reads the region from the current data, so the read-out follows data/geojson changes and clears when the region goes.
8.11 ImageCropper takes up a changed aspect prop.
8.13 Wizard catches a rejected validate/onValidateStep/onComplete and marks the step as having errors. LoadMore catches a rejected onLoadMore, shows "Couldn’t load more. Try again." and keeps the button. The comment composer keeps the text and shows "Couldn’t save. Try again." New strings listing.loadMoreFailed and display.composerFailed, en + dv.

Skipped ([P] / device check)

  • 8.7 last bullet: object URL revoked after 0 ms.
  • 8.9 last bullet: MapRadius double report.
  • 8.10 TimeSeriesChart zoom range.
  • 8.12: optional peers at app build time (needs a fixture app).

Could not reproduce

  • None. Every item in scope had a failing test before its fix.

Behaviour/API changes worth noting

  • SignaturePad penColor defaults to "#000" (was the theme text colour). In dark mode the canvas is shown inverted. classNames.canvas no longer carries the border/background, which are now on the wrapper.
  • TimeSeriesChart has a new aggregate?: "sum" | "mean". With interval, each point's __time is now the start of its step (it used to be the row's own time).
  • LiveMapSubscribe is now (push, remove) => unsubscribe.
  • ScannerStatus adds "decoder-error". A detector that fails to load no longer gives "unsupported".
  • MapContextValue adds region.
  • New strings, each with a Dhivehi version (please have a native speaker check them): file.qrDownloadFailed, input.scanDecoderError, listing.loadMoreFailed, display.composerFailed.

Overlaps with other open parts

Verification

  • pnpm lint, pnpm format:check, pnpm typecheck: pass.
  • pnpm --filter @javaabu/onu exec vitest run --maxWorkers=3: 197 files, 2885 passed, 1 skipped.
  • TZ=Indian/Maldives run of src/export and src/charts: 223 passed.
  • node scripts/check-docs.mjs: Docs OK.
  • pnpm build && pnpm --filter @javaabu/onu size: build OK, all budgets pass, none raised.

🤖 Generated with Claude Code

agent and others added 13 commits November 18, 2026 05:39
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 8.3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#66, 8.5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ure feedback (#66, 8.7)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d decoder (#66, 8.8)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…de in the provider region (#66, 8.9)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#66, 8.13)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…8-media-export

# Conflicts:
#	packages/onu/src/components/layout/wizard.tsx
@n4ff4h
n4ff4h merged commit 5acf4ac into dev Nov 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant